home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Weird Problem with arrays
- Date: 15 Feb 96 12:00:20 GMT
- Organization: CERN European Lab for Particle Physics
- Distribution: inet
- Message-ID: <danpop.824385620@rscernix>
- References: <4fr2ad$8ch@metro.usyd.edu.au>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4fr2ad$8ch@metro.usyd.edu.au> bernardd@wr.com.au (Bernard Doyle) writes:
-
- #define far /* to make the article suitable for c.l.c :-) */
-
- >I am currently writing a program running under MS-DOS that has a lot of
- >character arrays - about 100 kilobytes worth. These are declared globally
- >as :-
- >
- >char far example[750][20];
- >
- >and are initialised by reading in a text file when the program starts up.
- >These arrays are all needed throughout the program.
- >
- >A strange problem has occurred (although it may not be strange to someone
- >more knowledgeable than myself).
- >
- >I have a number of other global variables not declared as far. Recently I
- >changed one of these variables from an int to an integer array, (and also
- >changed all references to the variable in the program to reflect this of
- >course). However, now at least one of the character arrays appears to have
- >been corrupted by this action. Specifically when I search it, it doesn't
- >seem to contain the data that it should.
- >
- >Why is this happening and is there a solution?
-
- In the process of modifying the code you have either introduced a bug
- or exposed an existing bug which didn't manifest itself before the
- changes.
-
- The solution is to find the bug and fix it :-)
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-